package com.cn.pw.frame.dao;

import java.util.List;

import org.springframework.dao.DataAccessException;

import com.cn.pw.frame.dao.entity.Role;
import com.cn.pw.frame.dao.entity.User;

public interface UserDao {

	/**
	 * save user 
	 * 
	 * @return 
	 * @throws DataAccessException
	 */

	public void saveUser(List<User> users) throws DataAccessException;
	
	/**
	 * get user by name
	 * 
	 * @return user
	 * @throws DataAccessException
	 */
	
	public User findUserbyName(String name) throws DataAccessException;
	
	/**
	 * @param id
	 * @return
	 * @throws DataAccessException
	 */
	public User findUserById(Integer id) throws DataAccessException;
	
	/**
	 * get role by name
	 * 
	 * @return role
	 * @throws DataAccessException
	 */

	public Role findRoleByName(String name) throws DataAccessException;
	
	/**
	 * get all users
	 * 
	 * @return user list
	 * @throws DataAccessException
	 */
	
	public List<User> findAllUsers() throws DataAccessException;
	
	/**
	 * get user by user 
	 * 
	 * @return user list
	 * @throws DataAccessException
	 */
	
	public List<User> findUsers(User user) throws DataAccessException;
	
	public void updateUser(User user) throws DataAccessException;
}
